Micron Document
welo git mirrors

Node / public / reticulum / commits / 20dfbcf

Commit 20dfbcf0cc86a0b9f4f08ecf4177ee3343a76c3b


Parents : c96e067
Author : Mark Qvist <mark@unsigned.io>
Date : 2021-12-11T17:26:45+01:00

Link activation time

Changes

2 files changed, 12 insertions(+), 0 deletions(-)


Diff

diff --git a/RNS/Link.py b/RNS/Link.py
index 0748dc77a..41664586b 100644
--- a/RNS/Link.py
+++ b/RNS/Link.py
@@ -123,6 +123,7 @@ class Link:
self.keepalive = Link.KEEPALIVE
self.watchdog_lock = False
self.status = Link.PENDING
+ self.activated_at = None
self.type = RNS.Destination.LINK
self.owner = owner
self.destination = destination
@@ -245,6 +246,7 @@ class Link:
self.had_outbound()
self.status = Link.ACTIVE
+ self.activated_at = time.time()
if self.callbacks.link_established != None:
thread = threading.Thread(target=self.callbacks.link_established, args=(self,))
thread.setDaemon(True)
@@ -334,6 +336,8 @@ class Link:
rtt = umsgpack.unpackb(plaintext)
self.rtt = max(measured_rtt, rtt)
self.status = Link.ACTIVE
+ self.activated_at = time.time()
+
if self.owner.callbacks.link_established != None:
self.owner.callbacks.link_established(self)

diff --git a/RNS/Transport.py b/RNS/Transport.py
index 0d397fb2c..e21074dce 100755
--- a/RNS/Transport.py
+++ b/RNS/Transport.py
@@ -1032,6 +1032,9 @@ class Transport:
# Handling for proofs and link-request proofs
elif packet.packet_type == RNS.Packet.PROOF:
if packet.context == RNS.Packet.LRPROOF:
+ # TODO: Remove debug
+ RNS.log("Link request proof received")
+
# This is a link request proof, check if it
# needs to be transported
if (RNS.Reticulum.transport_enabled() or for_local_client_link or from_local_client) and packet.destination_hash in Transport.link_table:
@@ -1048,10 +1051,15 @@ class Transport:
else:
RNS.log("Link request proof received on wrong interface, not transporting it.", RNS.LOG_DEBUG)
else:
+ # TODO: Remove debug
+ RNS.log("Could not transport link request proof")
+
# Check if we can deliver it to a local
# pending link
for link in Transport.pending_links:
if link.link_id == packet.destination_hash:
+ # TODO: Remove debug
+ RNS.log("Delivering link request proof to local pending link", RNS.LOG_DEBUG)
link.validate_proof(packet)
elif packet.context == RNS.Packet.RESOURCE_PRF:

Served by rngit 1.5.1 - Generated in 0.06s